package org.event.core.service.event;

import org.event.core.entity.PaymentInfo;
import org.event.core.event.TestEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

/**
 * @author zhangjm
 * @date 2023年11月29日 16:39
 */
@Service
public class PaymentService {
    @Autowired
    ApplicationContext applicationContext;

    public void doService() {
        System.out.println(this.getClass().getName() + " 准备做出一些改变，这些改变将会影响到其他的地方");

        PaymentInfo paymentInfo = new PaymentInfo(123, "无所谓什么状态了,就是个测试而已");

        TestEvent event = new TestEvent(paymentInfo);

        applicationContext.publishEvent(event);

    }

}
